<?php
@session_start();
include_once 'session_var.php';
if($_SESSION['web']!=true) {
		$_SESSION['languaje'] = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2);
		//header('Location: http://firstclassapartment.com.ar/'.$_SESSION['languaje'].'/location-contact.php');
		header('Location: //localhost/firstclassapartmentscordoba/'.$_SESSION['languaje'].'/location-contact.php');
	}else {
		include("../lang/{$_SESSION['languaje']}.php");
	}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang=<?php echo $_SESSION['languaje'];?>>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content=<?php echo $locont_description;?>>
		<meta name="author" content="Pulce Web Solutions - www.pulce.com.ar">
		<!--Para que las páginas se muestren correctamente y el zoom funcione bien en los dispositivos móviles-->
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="keywords" content="<?php echo $index_keywords;?>">

		<title><?php echo $locont_title?></title>

		<?php
			include_once('links.php');
			include_once('recaptchalib.php');
			include_once("analytics.php");
		?>

		<link href="../css/tooltipster.css" rel="stylesheet">
		
		<!--JQUERY-->
		<!--<script src="http://code.jquery.com/jquery-2.1.0.js"></script>-->
		<script src="../js/jquery-2.1.0.min.js"></script>
		<!-- BACKSTRECH -->
		<script src="../js/jquery.backstretch.min.js"></script>
		<!--BOOTSTRAP-->
		<script src="../js/bootstrap.min.js"></script>
		<!-- DROPDOWN -->
		<script src="../js/dropdown.js"></script>
		<!-- TOOLTIP -->
		<script src="../js/jquery.tooltipster.min.js"></script>
		<!--FUNCTIONS-->
		<script src="../js/functions.js"></script>
		<!--GOOGLEMAPS-->
		<script src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script>

		<style>
	    	#map {
	        	height: 30em;
	        	margin: 0px;
	        	padding: 0px
	      	}
	    </style>

	    <div id="fb-root"></div>
		<script>(function(d, s, id) {
		  var js, fjs = d.getElementsByTagName(s)[0];
		  if (d.getElementById(id)) return;
		  js = d.createElement(s); js.id = id;
		  js.src = "//connect.facebook.net/es_LA/sdk.js#xfbml=1&version=v2.0";
		  fjs.parentNode.insertBefore(js, fjs);
		}(document, 'script', 'facebook-jssdk'));</script>

		<script type="text/javascript">
			$(document).ready(function(){
				//Cargo combo pais
				g("../ajax.php?"+a('ArmarComboPais')+c('table','T_COUNTRIES')+c('id','id_country')+c('value','chr_name_<?php echo $_SESSION['languaje'];?>')+c('msgSelect','<?php echo $msg_select;?>')+c('name','inputCountry')+c('tabindex','3'), 'SelectCountry' , '' , 'img-loading');
				
				//Codigo telefonico
				$('#SelectCountry').change(function() {
					var id = $("#inputCountry").val();
					g("../ajax.php?"+a('returnDialCode')+c('id',id), 'dialingCode' , '' , 'img-loading');
				});
				$('#form-data').on('change',function(e){
					if (isSet('div-msg'))
						$('#div-msg').fadeOut();
				});
			});
			var map;
			function initialize() {
				var mapOptions = {
					zoom: 15,
					center: new google.maps.LatLng(-31.410702, -64.201937)
				};
				map = new google.maps.Map(document.getElementById('map'),mapOptions);
				//Icono
				var image = 'http://firstclassapartment.com.ar/public/img/marcador-map.png';
				var myLatLng = new google.maps.LatLng(-31.410702, -64.201937);
				var marker = new google.maps.Marker({
				      position: myLatLng,
				      map: map,
				      icon: image
  				});

				google.maps.event.addListener(marker, 'click', function() {
					infowindow.open(map,marker);
				});
			}

			google.maps.event.addDomListener(window, 'load', initialize);



		</script>
	</head>
	<body>
		<div id="menu_bar">
				<?php include_once('menu_bar.php');?>
			</div>
		<div class="container">
			
			<div id="backstretch">
				<script>
					// Duration is the amount of time in between slides,
					// and fade is value that determines how quickly the next image will fade in
					$.backstretch([
					"../img/bkcontact.jpg"
					],{duration: 5000,fade:750});
				</script>
			</div>
			<div class="row">
				<div class="col-xs-6">
					<div class="box-central">
						<h1>
							<?php echo $locont_location_title;?>
						</h1>
						<p><?php echo $locont_location_description;?></p>

						<div id="map">
							<!--<iframe frameborder="0" style="border:0" class="iframe-map" src="https://www.google.com/maps/embed/v1/place?q=First%20Class%20Apartments&key=AIzaSyA_v0M2uUPoFF_ilcu3VIebzXoDsjDOvb8"></iframe>-->
						</div>
						<p style="text-align:center;"><?php echo $locont_location_gps;?> (-31.410702, -64.201937)</p>

						
					</div>
				</div>
				<div class="col-xs-6">
					<div class="row">
						<div class="box-central">
							<div class="row">
								<div class="col-xs-3">
									<h1>
										<?php echo $locont_contact_title;?>
									</h1>
								</div>
								<div class="col-xs-9" style="text-align:left;">
									<div id="img-loading"></div>
								</div>
							</div>	
							<p><?php echo $locont_contact_description;?></p>
							<div id="form-data">
								<form id="book-data">
									<div class="row margin-top-1em">
										<div class="form-group">
											<label for="inputName" class="col-xs-2 control-label label-custom"><?php echo $book_data_name.' *';?></label>
										    <div class="col-xs-4">
										    	<input type="text" class="form-control" id="inputName" placeholder="<?php echo $book_data_name_h;?>" tabindex="1">
										    </div>
											<label for="inputLastName" class="col-xs-2 control-label label-custom"><?php echo $book_data_last_name.' *';?></label>
										    <div class="col-xs-4">
										    	<input type="text" class="form-control" id="inputLastName" placeholder="<?php echo $book_data_last_name_h;?>" tabindex="2">
										    </div>
									  	</div>
									</div>
									<div class="row margin-top-1em">
										<div class="form-group">
											<label for="inputCountry" class="col-xs-2 control-label label-custom"><?php echo $book_data_country.' *';?></label>
										    <div class="col-xs-10">
										    	<div id="SelectCountry"></div>
											</div>
										</div>
									</div>
									<div class="row margin-top-1em">
										<div class="form-group">
											<label for="inputEmail" class="col-xs-2 control-label label-custom"><?php echo $book_data_email.' *';?></label>
											    <div class="col-xs-4">
													<input id="inputEmail" type="email" class="form-control" placeholder="<?php echo $book_data_email_h;?>"  tabindex="4">
												</div>
											<label for="inputPhone" class="col-xs-2 control-label label-custom"><?php echo $book_data_phone;?></label>
											<div class="col-xs-4">
												<div class="input-group">
													<span id="dialingCode" class="input-group-addon"></span>
													<input id="inputPhone" type="text" class="form-control" placeholder="<?php echo $book_data_phone_h;?>" tabindex="5">
												</div>
											</div>
										</div>
									</div>
									<div class="row margin-top-1em">
										<div class="form-group">
											<label for="inputQuestion" class="col-xs-2 control-label label-custom"><?php echo $locont_contact_question.'*';?></label>
											<div class="col-xs-10">
												<textarea class="form-control" id="inputQuestion" placeholder="<?php echo $locont_contact_question_h;?>" tabindex="6"></textarea>
											</div>
										</div>
									</div>
									<div class="row margin-top-1em">
										<div class="col-xs-offset-2 col-xs-7">
	  										<?php echo recaptcha_get_html('6LfoDfYSAAAAAM7HikdWs9qJwgfGCXA2aQnOdP73');?>
										</div>
										<div class="col-xs-3">
											<div id="send" style="text-align: right;">
												<button id="btn-send" type="button" class="btn btn-success btn-custom"><?php echo $locont_contact_send;?></button>
											</div>
										</div>
									</div>
								</form>
							</div>
							<script type="text/javascript">
							$('#btn-send').on('click',function(e){
								if (isSet('div-msg'))
									$('#div-msg').fadeOut();
								g('../ajax.php?'+a('validateContact')+v('inputName')+v('inputLastName')+v('inputCountry')+v('inputEmail')+v('inputPhone')+v('inputQuestion')+v('recaptcha_response_field')+v('recaptcha_challenge_field'),'result', 'div-msg' , 'img-loading');
								});	
							</script>
							<div id="div-msg" style="display: none"></div>
							<div id="result"></div>
						</div>
					</div>
					<div class="row">
						<div class="col-xs-4">
							<div class="fb-like" data-href="https://www.facebook.com/pages/First-Class-Apartments-C%C3%B3rdoba/626206697400314" data-layout="standard" data-action="like" data-show-faces="true" data-share="false"></div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div id="footer">
			<?php include("footer.php");?>
		</div>
	</body>
</html>